﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Diagnostics;

namespace Ridofy.Spotify
{
    public class SpotifyClient : ClientBase<ISpotifyApi>, ISpotifyClient
    {
        public SpotifySearchResult SearchTrack(string trackname)
        {
            try
            {
                return Channel.SearchTrack(trackname);
            }
            catch (ProtocolException ex)
            {
                Trace.WriteLine(ex.ToString());
                return new SpotifySearchResult
                {                    
                    Tracks = null
                };
            }
        }
    }
}
